package 状态模式;

/**
 * @author zzs
 * @ClassName HaveQuantity.java
 * @Description
 * @createTime 2022年05月18日 20:50:00
 */
public class HaveQuantity implements Status {
    public Sweet sweet;

    public HaveQuantity(Sweet sweet) {
        this.sweet = sweet;
    }

    @Override
    public void put() {
        System.out.println("加钱");
    }

    @Override
    public void turn() {
        System.out.println("转盘");
        Sweet.status = sweet.getSoldOut();
    }

    @Override
    public void refund() {
        System.out.println("退钱成功");
        Sweet.status = sweet.getNoQuantity();
    }

    @Override
    public void pop() {
        System.out.println("出糖果");
    }
}
